{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "fd3eddd8",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "19b9e3d4",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "   No      Name  Age  Class Section  Phone number location\n",
      "0  11  Abdullah   20     12  Ghouri     300300003   multan\n",
      "1   2       ali   12     12  Ghouri     300300003   multan\n",
      "2   3      omer   13     12  Ghouri     300300003   multan\n"
     ]
    }
   ],
   "source": [
    "d = pandas.read_csv(\"pandas.csv\")\n",
    "print(d)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "af3d1cb6",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "    0         1    2      3        4             5         6\n",
      "0  No      Name  Age  Class  Section  Phone number  location\n",
      "1  11  Abdullah   20     12   Ghouri     300300003    multan\n",
      "2   2       ali   12     12   Ghouri     300300003    multan\n",
      "3   3      omer   13     12   Ghouri     300300003    multan\n"
     ]
    }
   ],
   "source": [
    "import pandas\n",
    "x = pandas.read_csv(\"pandas.csv\" , header = None)\n",
    "print(x)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3775d92a",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "e9915013",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "   No      Name  Age  Class Section  Phone number location\n",
      "0  11  Abdullah   20     12  Ghouri     300300003   multan\n",
      "1   2       ali   12     12  Ghouri     300300003   multan\n",
      "2   3      omer   13     12  Ghouri     300300003   multan\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\ABDULL~1\\AppData\\Local\\Temp/ipykernel_9436/1520031434.py:1: UserWarning: Pandas doesn't allow columns to be created via a new attribute name - see https://pandas.pydata.org/pandas-docs/stable/indexing.html#attribute-access\n",
      "  d.colums = [\"Name\",\"Age\",\"Class\",\"Section\",\"new addition\"]\n"
     ]
    }
   ],
   "source": [
    "d.colums = [\"Name\",\"Age\",\"Class\",\"Section\",\"new addition\"]\n",
    "print(d)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "c7466906",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>No</th>\n",
       "      <th>Name</th>\n",
       "      <th>Age</th>\n",
       "      <th>Class</th>\n",
       "      <th>Section</th>\n",
       "      <th>Phone number</th>\n",
       "      <th>location</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Class</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>11</td>\n",
       "      <td>Abdullah</td>\n",
       "      <td>20</td>\n",
       "      <td>12</td>\n",
       "      <td>Ghouri</td>\n",
       "      <td>300300003</td>\n",
       "      <td>multan</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>2</td>\n",
       "      <td>ali</td>\n",
       "      <td>12</td>\n",
       "      <td>12</td>\n",
       "      <td>Ghouri</td>\n",
       "      <td>300300003</td>\n",
       "      <td>multan</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>3</td>\n",
       "      <td>omer</td>\n",
       "      <td>13</td>\n",
       "      <td>12</td>\n",
       "      <td>Ghouri</td>\n",
       "      <td>300300003</td>\n",
       "      <td>multan</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       No      Name  Age  Class Section  Phone number location\n",
       "Class                                                         \n",
       "12     11  Abdullah   20     12  Ghouri     300300003   multan\n",
       "12      2       ali   12     12  Ghouri     300300003   multan\n",
       "12      3      omer   13     12  Ghouri     300300003   multan"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d.set_index(\"No\", inplace=True , drop=False)\n",
    "d.set_index(\"Section\", inplace=True , drop=False)\n",
    "d.set_index(\"Class\", inplace=True , drop=False)\n",
    "d"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "1426fce8",
   "metadata": {},
   "outputs": [],
   "source": [
    "# import pandas\n",
    "# df2 = pandas.read_json(\"supermarkets.json\")\n",
    "# print(df2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "815ed6f7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['.ipynb_checkpoints',\n",
       " 'Adobe Photoshop 2020.lnk',\n",
       " 'desktop.ini',\n",
       " 'ecommerce website.txt',\n",
       " 'Internet Download Manager.lnk',\n",
       " 'Jupyter notebook',\n",
       " 'pandas.csv',\n",
       " 'pandas.ipynb',\n",
       " 'pandas.txt',\n",
       " 'Untitled.ipynb',\n",
       " 'Zoom.lnk']"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas\n",
    "from pandas import *\n",
    "import os\n",
    "os.listdir()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "e67798b0",
   "metadata": {},
   "outputs": [],
   "source": [
    "pandas.read_csv?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0fc69b6b",
   "metadata": {},
   "outputs": [],
   "source": [
    "import array\n",
    "from array import *\n",
    "arr = array(\"i\",[])\n",
    "user = int(input(\"Enter the length of the array  \"))\n",
    "for i in range(user):\n",
    "    value = int(input(\"Enter the values  \"))\n",
    "    arr.append(value)\n",
    "    \n",
    "print(arr)\n",
    "\n",
    "# in order to defined the indexes\n",
    "x = int(input(\"Enter the value to find out the index of the value  \"))\n",
    "k  = 0\n",
    "for e in arr:\n",
    "    if e == x:\n",
    "        print(k)\n",
    "    k +=1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "984c059f",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas\n",
    "df = pandas.to_csv(\"pandas.csv\")\n",
    "print(df)\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8fd1346b",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "013e401e",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a54038b8",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d3e625be",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
